var selected = 'images/tab_selected_blue.png';
var unselected = 'images/tab_blue.png';
var selectedColor = '#fff';
var unselectedColor = '#aaa';

var searchTab = Ti.UI.createView({
	height: 38,
	width: 150,
	top: 0,
	left: 7,
	backgroundImage: selected
});
var searchLabel = Ti.UI.createLabel({
	title: 'Search',
	font: {fontWeight: 'bold'},
	color: selectedColor
});
searchTab.add(searchLabel);
var searchPanel = Ti.UI.createView({
	height: 390,
	width: 320,
	top: 0,
	left: 0,
	layout: 'vertical'
});



var favoriteTab = Ti.UI.createView({
	height: 38,
	width: 150,
	top: 0,
	left: 163,
	backgroundImage: unselected
});
var favoriteLabel = Ti.UI.createLabel({
	title: 'Favorites',
	font: {fontWeight: 'bold'},
	color: unselectedColor
});
favoriteTab.add(favoriteLabel);
var favoritePanel = Ti.UI.createView({
	height: 390,
	width: 320,
	top: 0,
	left: 0
});

searchTab.addEventListener('click', ShowSearch);

favoriteTab.addEventListener('click', ShowFavorite);

function ShowSearch(){
	searchTab.backgroundImage = selected;
	searchLabel.color = selectedColor;
	searchPanel.show();
	favoriteTab.backgroundImage = unselected;
	favoriteLabel.color = unselectedColor;
	favoritePanel.hide();
}

function ShowFavorite(){
	searchTab.backgroundImage = unselected;
	searchLabel.color = unselectedColor;
	searchPanel.hide();
	favoriteTab.backgroundImage = selected;
	favoriteLabel.color = selectedColor;
	favoritePanel.show();
}